All Questions
11 questions
2votes
1answer
341views
JavaScript copy-to-clipboard class
I am have made a small copy-to-clipboard script. I have made a method called copyToClipboard that does the following: create an input box; read the content of an ...
5votes
3answers
428views
Wrap a js function with a fixed this arg
If I use node.addEventListener('click',Wyg.Editor.nodeClickedEvent); then when node is clicked, ...
2votes
0answers
51views
Event handler re-use in Javascript
I've been trying to deal with a lot of duplicate code in the first web pages I've been working on and have been playing around with the prototype model, which I think is the 'right' way to go about it....
2votes
1answer
807views
Event emitter in JavaScript without using Node's built in class or any additional libraries
I need to create this eventEmitter class with the functions listed below. I think I could clean the code a little but don't really know where to start. ...
3votes
1answer
55views
JavaScript idle managing structure
I am just getting into the world of javascript, coming from the world of classical inheritance. The following is a library I wrote to track when a webapp is idling and I wrote it like I write ...
3votes
2answers
610views
Custom event handler in Javascript
In my web projects I often need a simple way to trigger callbacks defined somewhere else. Leaving jQuery finally behind me, I was missing their simple event system and tried to create my own. I'd like ...
4votes
1answer
133views
YouTube video intro, and autoscroll when video ends
This code creates an intro video using the Youtube API, screen text written by JavaScript with a typewriter kind of effect. How can I rewrite this as succinct object-oriented code? Also, I'm not sure ...
4votes
0answers
85views
Comparison of sprite movement implementations
I've come up with two ways to do sprite movement with CreateJS, and I'm wondering if one is better than the other as far as performance and maintainability. The player data is saved in a json file ...
7votes
1answer
549views
Custom event hub
I'm creating an event hub object in for a large project I am building in JavaScript. The project will have modules in charge of the UI, commands, and rendering. Each module will use this hub for ...
6votes
1answer
3kviews
Navigation bar built from fetched JSON data
I have finally been able to create my little navigation plugin in an object-oriented way that reads the li from a JSON file. Now, is my code efficient? Especially, ...
1vote
1answer
2kviews
Is this use of JavaScript prototype functions for attaching event listeners going to meet design goals?
Please provide a sanity check on my below JavaScript pattern to be used for a custom edit control. The goals are: Centralized code Avoid name collisions Minimize memory use (putting functions on the ...